package com.aiyige.model;

import com.aiyige.model.enums.GoodsType;
import com.aiyige.utils.StringUtils;

import java.util.List;

/**
 * Created by xiachao on 2017/11/15.
 */

public class DetailInfo {
    public static final int TYPE_PHOTO = 1;
    public static final int TYPE_VIDEO = 2;
    public static final int TYPE_INFO = 3;
    public static final int TYPE_SPECIFIC_TOPIC = 4;
    public static final int TYPE_LEARN_VDIEO = 5;
    public static final int TYPE_MAJOR_COURSE = 6;
    public static final int TYPE_TRAING_CARD = 7;
    public static final int TYPE_PERSONAL_TRAINER = 8;
    private int id;
    private String type;
    private String cover;
    private String title;
    private String detail;
    private long createTime;
    private String owner;
    private int ownerId;
    private int ownerLevel;
    private String phone;
    private String ownerAvatar;
    private boolean isFolowered;
    private int categoryId;
    private int brandId;
    private int durationTotal;
    private List<VideoEntity> videos;
    private List<ImageEntity> images;
    private int price;
    private int originPrice;
    private List<Integer> freeStages;
    private List<TagEntity> allTags;
    private List<GuaranteeEntity> guarantees;
    private String city;
    private String platform;
    private int sellCount;
    private int commentCount;
    private int praiseCount;
    private int favoriteCount;
    private int watchCount;
    private boolean iamPraised;
    private boolean iamCommented;
    private boolean iamFavorited;
    private String router;
    private List<GoodsEntity> myOthers;
    private List<GoodsEntity> recommend;
    private List<CommentEntity> comments;

    public int getHasBuy() {
        return hasBuy;
    }

    public void setHasBuy(int hasBuy) {
        this.hasBuy = hasBuy;
    }

    private int hasBuy;
    /**
     * //是否需要支付，这个由类型判断
     * @return
     */
    public boolean needPay() {
        return type != null && type.equals(GoodsType.TYPE_VIDEO_COURSE.getType());
    }


    public boolean isBuy() {
        return hasBuy == 1;
    }

    public void setIsBuy(boolean buy) {
        hasBuy = buy?1:0;
    }

    public void setId(int id) {
        this.id = id;
    }
    public int getId() {
        return id;
    }

    public void setType(String type) {
        this.type = type;
    }
    public String getType() {
        return type;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }
    public String getCover() {
        return cover;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public String getTitle() {
        return StringUtils.getTextString(title);
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }
    public String getDetail() {
        return StringUtils.getTextString(detail);
    }

    public void setCreateTime(int createTime) {
        this.createTime = createTime;
    }
    public long getCreateTime() {
        return createTime;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }
    public String getOwner() {
        return StringUtils.getTextString(owner);
    }

    public void setOwnerId(int ownerId) {
        this.ownerId = ownerId;
    }
    public int getOwnerId() {
        return ownerId;
    }

    public void setOwnerLevel(int ownerLevel) {
        this.ownerLevel = ownerLevel;
    }
    public int getOwnerLevel() {
        return ownerLevel;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getPhone() {
        return StringUtils.getTextString(phone);
    }

    public void setOwnerAvatar(String ownerAvatar) {
        this.ownerAvatar = ownerAvatar;
    }
    public String getOwnerAvatar() {
        return StringUtils.getTextString(ownerAvatar);
    }

    public void setIsFolowered(boolean isFolowered) {
        this.isFolowered = isFolowered;
    }
    public boolean getIsFolowered() {
        return isFolowered;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }
    public int getCategoryId() {
        return categoryId;
    }

    public void setBrandId(int brandId) {
        this.brandId = brandId;
    }
    public int getBrandId() {
        return brandId;
    }

    public void setDurationTotal(int durationTotal) {
        this.durationTotal = durationTotal;
    }
    public int getDurationTotal() {
        return durationTotal;
    }

    public void setVideos(List<VideoEntity> videos) {
        this.videos = videos;
    }
    public List<VideoEntity> getVideos() {
        return videos;
    }

    public void setImages(List<ImageEntity> images) {
        this.images = images;
    }
    public List<ImageEntity> getImages() {
        return images;
    }

    public void setPrice(int price) {
        this.price = price;
    }
    public int getPrice() {
        return price;
    }

    public void setOriginPrice(int originPrice) {
        this.originPrice = originPrice;
    }
    public int getOriginPrice() {
        return originPrice;
    }

    public void setFreeStages(List<Integer> freeStages) {
        this.freeStages = freeStages;
    }
    public List<Integer> getFreeStages() {
        return freeStages;
    }

    public void setAllTags(List<TagEntity> allTags) {
        this.allTags = allTags;
    }
    public List<TagEntity> getAllTags() {
        return allTags;
    }

    public void setGuarantees(List<GuaranteeEntity> guarantees) {
        this.guarantees = guarantees;
    }
    public List<GuaranteeEntity> getGuarantees() {
        return guarantees;
    }

    public void setCity(String city) {
        this.city = city;
    }
    public String getCity() {
        return StringUtils.getTextString(city);
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }
    public String getPlatform() {
        return StringUtils.getTextString(platform);
    }

    public void setSellCount(int sellCount) {
        this.sellCount = sellCount;
    }
    public int getSellCount() {
        return sellCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }
    public int getCommentCount() {
        return commentCount;
    }

    public void setPraiseCount(int praiseCount) {
        this.praiseCount = praiseCount;
    }
    public int getPraiseCount() {
        return praiseCount;
    }

    public void setFavoriteCount(int favoriteCount) {
        this.favoriteCount = favoriteCount;
    }
    public int getFavoriteCount() {
        return favoriteCount;
    }

    public void setWatchCount(int watchCount) {
        this.watchCount = watchCount;
    }
    public int getWatchCount() {
        return watchCount;
    }

    public void setIamPraised(boolean iamPraised) {
        this.iamPraised = iamPraised;
    }
    public boolean getIamPraised() {
        return iamPraised;
    }

    public void setIamCommented(boolean iamCommented) {
        this.iamCommented = iamCommented;
    }
    public boolean getIamCommented() {
        return iamCommented;
    }

    public void setIamFavorited(boolean iamFavorited) {
        this.iamFavorited = iamFavorited;
    }
    public boolean getIamFavorited() {
        return iamFavorited;
    }

    public void setRouter(String router) {
        this.router = router;
    }
    public String getRouter() {
        return StringUtils.getTextString(router);
    }

    public void setMyOthers(List<GoodsEntity> myOthers) {
        this.myOthers = myOthers;
    }
    public List<GoodsEntity> getMyOthers() {
        return myOthers;
    }

    public void setRecommend(List<GoodsEntity> recommend) {
        this.recommend = recommend;
    }
    public List<GoodsEntity> getRecommend() {
        return recommend;
    }

    public void setComments(List<CommentEntity> comments) {
        this.comments = comments;
    }
    public List<CommentEntity> getComments() {
        return comments;
    }
}
